package com.admin.common.thread;


import java.util.concurrent.*;

public class TestThreadCallable implements Callable<Boolean> {

    private String url;
    private String name;
    public TestThreadCallable () {

    }

    public TestThreadCallable(String url, String name) {
        this.url = url;
        this.name = name;
    }

    public void dowLoad(String url,String name) {
        System.out.println(url + name);
    }

    @Override
    public Boolean call() throws Exception {
        TestThreadCallable tt = new TestThreadCallable();
        tt.dowLoad(url, name);
        return true;
    }

    public static void main(String[] args) throws ExecutionException, InterruptedException {
        TestThreadCallable t = new TestThreadCallable("1111", "wwwww");
        ExecutorService se = Executors.newFixedThreadPool(2);
        Future<Boolean> r1 = se.submit(t);

        System.out.println(r1.get());

        se.shutdownNow();
    }
}
